<?php

/**
 * Created by PhpStorm
 * User: 林振宇
 * Date: 2020/8/12
 * Time: 15:34
 */

namespace app\api\controller;

use app\api\service\TokenService;
use app\api\service\UserService;

class User extends Base
{
    protected $user_info;

    public function __construct()
    {
        $this->user_info = (new TokenService())->checkToken();
    }

    //个人信息
    public function getUserInfo()
    {
        $userInfo = (new UserService())->getUserInfo($this->user_info['id']);
        $this->success('success', $userInfo);
    }

    //平台公告
    public function getNotice()
    {
        $notice = (new UserService())->getNotice();
        $this->success('success', $notice);
    }

    //平台公告详情
    public function getNoticeDetails()
    {
        $data = (new UserService())->getNoticeDetails();
        $this->success('success', $data);
    }

    //关于我们
    public function getAbout()
    {
        $about = (new UserService())->getAbout();
        $this->success('success', $about);
    }

}
